package demo.java8.ClassLoad;

/**
 * Created by Administrator on 2017/5/13.
 */
public class TestClassLoad {
    public static void main(String[] args) {
        System.out.println(ClassB.pig);
        System.out.println(ClassB.dog);
        System.out.println(ClassC.big);
    }
}
class ClassA{
    static String pig = "this is a pig";
    static{
        System.out.println("ClassA is initialized");
    }
}
class ClassB extends ClassA{
    static final String dog = "this is a dog";
    static{
        System.out.println("ClassB is initialized");
    }
}
class ClassC extends ClassA{
    static String big = "this is the big pig";
    static{
        System.out.println("ClassC is initialized");
    }
}